<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-show指令</title>
</head>
<body>
    <div id="app">
        <input type="button" value="显示/隐藏图片" @click="changeShow">
        <img src="陈意涵.JPG" alt="陈意涵" v-show="isShow">
        <img src="陈意涵.JPG" alt="陈意涵" v-show="age>=18">
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script>
        let app = new Vue({
            el:"#app",
            data:{
                isShow:false,
                age:18
            },
            methods:{
                changeShow:function () {
                    this.isShow = !this.isShow;
                }
            }
        })
    </script>
</body>
</html>